package com.tgy.mapper;

import com.tgy.entity.User;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/***
 * @ClassName: UserMapperImpl
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 0:23 2021/12/19
 * @version : V1.0
 */
public class UserMapperImpl implements UserMapper{


    //我们原来的所有操作都使用sqlSession 现在都用SqlSessionTemplate
    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    @Override
    public List<User> getAll() {
        return null;
    }

    public List<User> getA(){
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        return mapper.getAll();
    }
}
